<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <style>
        * {
            padding:0;
            margin:0;
            text-align: center;
        }

        header, footer{
            clear:both;
            background-color: gray;
        }

        #content>div{
            float:left;
        }
        #content{
            padding:0 100px;
        }
        .center{
            width:100%;
            background-color: green;
        }
        .left, .right{
            width:100px;
            background-color: burlywood;
        }
        .left{
            margin-left:-100%;
            position: relative;
            left:-100px;
        }
        .right{
            margin-right:-100px;
        }

    </style>
</head>
<body>
    <header>header</header>
    <div id ="content">
        <!-- 圣杯布局 -->
        <div class="center">中</div>    
        <div class="left">左</div>    
        <div class="right">右</div>    
    </div>
    <footer>footer</footer>
        
      
</body>
<script>
    function commafy(num){
        // d{3})+表示3的倍数个数字，如3个数字6个数字等，?=表示后面一定是3的倍数个数字
        // JavaScript replace() 方法
        return num && num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function($1, $2){return $2 + ',';});
    }

    var aa = commafy(1333890.11)
    console.log(aa);
</script>
</html>